fn roadType id=
(
	arrayNames = #("TwoLaneCurved","TwoLaneStraight","TwoByFourLaneIntersection","TwoLaneIntersection","TwoLaneTee","TwoByFourLaneTee","TwoLaneRoundAbout","TwoLaneParking","TwoLaneBus","TwoLaneBridge","FourLaneCurved","FourLaneStraight","FourLaneParking","FourLaneBus","FourLaneTee","FourLaneIntersection","FourLaneBridge")
	array2d = #(
	#("road64","road65","road66","road67","road127","road128","road129"),
	#("road1","road2","road3","road4","road5","road17","road21","road22","road23","road24","road169","road170","road171"),
	#("road167"),
	#("road165","road286","road137"),
	#("road166","road138","road285"),
	#("road168","road293","road284"),
	#("road160","road159"),
	#("road31","road32","road33","road56","road58","road61","road62"),
	#("road88","road89"),
	#("road133","road136"),
	#("road84","road85","road86","road87","road96","road97","road98","road130","road131","road132"),
	#("road6","road7","road8","road9","road10","road11","road12","road13","road14","road15","road16","road18","road19","road20","road25","road34","road174","road175"),
	#("road26","road27","road28","road29","road30","road35","road36","road37","road38","road39","road57","road59","road60","road63"),
	#("road90","road95"),
	#("road289","road291"),
	#("road287","road288","road290","road292"),
	#("road134","road135")
	)
	
	for i = 1 to array2d.count do
	(
		if((findItem array2d[i] id) > 0) then
		(
			return arrayNames[i]
		)
	)
	return "unknown"
)

outputFile = createFile "C:\\UDK\\UDK-2011-06\\UDKGame\\Config\\UDKRoadinfo.ini"

format "[SIMBAC.Checker]\n" to: outputFile
format "testValue=5\n" to: outputFile

for obj in objects where(obj.parent == undefined) do
(
minX = 99999
minY = 9999
minZ = 99999
maxX = -99999
maxY = -99999
maxZ = -99999

/*for f = 1 to obj.numfaces do
(
	FaceArea = polyop.getFaceArea obj f
	if ((obj.GetFaceMaterial f) == 3 and FaceArea > 150) then
	(
		centerPoint = polyop.getFaceCenter obj f
		
		if centerPoint.X < minX then minX = centerPoint.X
		if centerPoint.X > maxX then maxX = centerPoint.X
		if centerPoint.Y < minY then minY = centerPoint.Y			
		if centerPoint.Y > maxY then maxY = centerPoint.Y	
		--format "% %f\n" ((polyop.getFaceCenter obj f) as string) FaceArea
	)
)*/

format "road_names=(Name=\"%\",Type=\"%\")\n" (roadType obj.name) obj.name to: outputFile
)

close outputFile
	
	

	